package array

import "strings"

func IntInArray(num int, intArr []int) int {
	for index, val := range intArr {
		if val == num {
			return index
		}
	}
	return -1
}

func StrInArray(str string, strArr []string) int {
	for index, item := range strArr {
		if item == str {
			return index
		}
	}
	return -1
}

func StrContainArray(str string, strArr []string) []int {
	var in []int
	for index, item := range strArr {
		if strIndex := strings.Index(str, item); strIndex != -1 {
			in = append(in, index)
		}
	}
	return in
}
